package main

import (
	"fmt"
	"manyuser/client/process"
)

func case1(){
	var userId int
	var userPwd string
	fmt.Println("please enter userid")
	fmt.Scanln(&userId)
	fmt.Println("please enter userpwd")
	fmt.Scanln(&userPwd)
	(&process.UserProcess{}).Login(userId,userPwd)
	
}
func case2(){
	var userId int
	var userPwd string
	var userName string
	fmt.Println("please enter userid")
	fmt.Scanln(&userId)
	fmt.Println("please enter userpwd")
	fmt.Scanln(&userPwd)
	fmt.Println("please enter username")
	fmt.Scanln(&userPwd)
	(&process.UserProcess{}).Register(userId,userPwd,userName)
}
func main() {
	var key int
	loop := true
	for loop {
		fmt.Println("----------------欢迎登陆多人聊天系统-----------------")
		fmt.Println("\t\t\t 1登陆聊天室")
		fmt.Println("\t\t\t 2注册用户")
		fmt.Println("\t\t\t 3退出系统")
		fmt.Println("\t\t\t请选择(1-3):")

		fmt.Scanln(&key)
		switch key {
		case 1:
			fmt.Println("-----------登陆聊天室----------")
			case1()
		case 2:
			fmt.Println("-----------注册用户----------")
			case2()
		case 3:
			fmt.Println("-----------退出系统----------")
			loop = false
		default:
			fmt.Println("输入出错，请重新输入")
		}

	}
}
